package wangyi;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            if (n <= 0 || k < 1) {
                System.out.println(0);
            }

            long sum = 0L;
            for (int i = 1; i <= k; i++) {
                sum += number(i);
            }
            System.out.println(sum);
        }
    }

    private static int number(int k) {
        int num = 0;
        for (int i = 1; i <= k; i++) {
            if (i <= k) num++;
            else if (i % k != 0) num++;
        }
        return num;
    }
}